<?php
include("utils.php");
include("lang_buildCustomNetwork.php");
ob_start();
session_start();
define('NAME_SESSION_CURRENT_PAGE','CAMPAIGN');
if(!isset($_SESSION[siteuserId]))
echo '<script>location.href="index.php"</script>';
main_content("mainBuySpace();");
//mainBuySpace();

/**
 * render step infomation
 * total 4 step with an active step
 *
 * @return mixed html
 *
 */
function stepInfo($activeStep)
{
	$query = mysql_query("SELECT * FROM payment_method where userId={$_SESSION[siteuserId]}");
	$arrStep = array();
	$arrStep[1]="Campaign Info";
	$arrStep[2]="Ad Group Type";
	$arrStep[3]='Enter ads';
	if(mysql_num_rows($query)>0)
	{
		$arrStep[4]="Creative & Bid";
	}else{
		$arrStep[4]="Targeting";
		$arrStep[5]="Creative & Bid";
	}

?>
<div style="text-align: center"><?php for($i=1;$i<=count($arrStep);$i++):?>
	<label style="font-weight:<?php echo $i==($activeStep+1) ? "bold":"normal";?>"><?php echo "Step $i - " . $arrStep[$i];?></label>
		<?php if($i<count($arrStep)):?> | <?php endif;?> <?php endfor;?> <br /><br /><br />
</div>
<?php

}

function mainBuySpace()
{
	include_once("campaign/campaign.php");
?>



<script type="text/javascript">
	var GB_ROOT_DIR = "./greybox/";
</script>
<script type="text/javascript" src="JavaScripts/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="greybox/AJS.js"></script>
<script type="text/javascript" src="greybox/AJS_fx.js"></script>
<script type="text/javascript" src="greybox/gb_scripts.js"></script>
<link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="static_files/help.js"></script>
<link href="static_files/help.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript">
	//insertHeader();
	//insertMenu('examples');
	</script>

<!-- Links For JS CALENDER   -->
<link type="text/css" rel="stylesheet" href="dhtml_calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.css?random=20051112" media="screen" />
<script type="text/javascript" src="dhtml_calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.js?random=20060118"></script>
<!-- End line for JS CALENDER -->
<script type="text/javascript" src="js/ajax.js"></script>
<script type="text/javascript" src="js/ajaxresponse.js"></script>
<script type="text/javascript">
	function delete_ad(temp_ad_id,formId)
	{
	sendRequest('ajax/ajax_delete_ad.php','ad_id='+temp_ad_id+'&formId='+formId,'POST');
	}
	</script>
<script type="text/javascript" src="Javascripts/registration.js"></script>
<link href="css/global.css" rel="stylesheet" type="text/css">
<script type="text/javascript" type="text/javascript" src="Javascripts/datetimepicker.js"></script>


<input type="hidden" name="mode" value="UserRegistration" />
<!-- begin -->
<table width="95%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td valign="top">
		<table width="98%" border="0" align="center" cellpadding="0"
			cellspacing="0">
			<tr>
				<td width="20%" valign="top"><?php include("left_pannel.php"); ?></td>
				<td width="10px">&nbsp;</td>
				<td valign="top">
				<table width="98%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td valign="top" align="left">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td width="11" valign="top" align="left"><img
									src="images/PinkBorderTopLeft.jpg" alt="" width="11"
									height="11"></td>
								<td class="PinkBoxTopBg"><img src="images/spacer.gif" alt=""
									width="10" height="11"></td>
								<td width="11"><img src="images/PinkBorderTopRight.jpg" alt=""
									width="11" height="11"></td>
							</tr>
						</table>
						</td>
					</tr>
					<tr>
						<td class="PinkTwosideBorder" valign="top">

							<?php stepInfo($step);?>
							<center><?php

							if($step==1)
							{
								include_once("campaign/step2.php");
							}else if($step==2)
							{
								include_once("campaign/step3.php");
							}else if($step == 3)
							{
								include_once("campaign/step4.php");
							}else if($step==4)
							{
								include_once("campaign/step5.php");
							}

							else
							{
								
									include_once("campaign/step1.php");
								
							}

							?></center>

						</td>
					</tr>
					<tr>
						<td>
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td width="11"><img src="images/PinkBorderBottomLeft.jpg" alt=""
									width="11" height="11"></td>
								<td class="PinkBoxBottomBg"><img src="images/spacer.gif" alt=""
									width="10" height="11"></td>
								<td width="11"><img src="images/PinkBorderBottomRight.jpg"
									alt="" width="11" height="11"></td>
							</tr>
						</table>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
	</tr>
</table>



							<?php
							//include("footer.php");
}
?>